import request from '@/utils/request'

// api地址
const api = {
	list: '/gms/yoshopCoupon/list',
	draw: '/gms/yoshopCoupon/getCouponToUser',
	userCoupon: '/ums/yoshopUserCoupon/querySelfAllCouple',
	newCoupon: '/gms/yoshopCoupon/getNewCouponList '
}

// 优惠劵列表
export const list = (param) => {
	return request.get(api.list, param)
}
// 优惠劵领取
export const draw = (param) => {
	let params = `?couponId=${param.id}`;
	return request.post(api.draw + params)
}
// 用户优惠劵
export const userCoupon = (params) => {
	return request.get(api.userCoupon, params)
}
// 弹窗优惠劵
export const NewCoupon = (params) => {
	return request.get(api.newCoupon, params)
}